<?php

namespace App\Service\OpenShop\Feishu\Board;

use Illuminate\Http\Request;
use Jenssegers\Agent\Agent;

class BoardParam
{
    private Agent  $agent;
    private string $orderNo;
    private int    $missionId;

    /**
     * @return Agent
     */
    public function getAgent(): Agent
    {
        return $this->agent;
    }

    /**
     * @param Agent $agent
     */
    public function setAgent(Request $request): self
    {
        $agent = new Agent();
        $agent->setUserAgent($request->header('user-agent'));
        $agent->setHttpHeaders($request->headers->all());

        $this->agent = $agent;

        return $this;
    }

    /**
     * @return string
     */
    public function getOrderNo(): string
    {
        return $this->orderNo;
    }

    /**
     * @param string $orderNo
     */
    public function setOrderNo(string $orderNo): self
    {
        $this->orderNo = $orderNo;

        return $this;
    }

    /**
     * @return int
     */
    public function getMissionId(): int
    {
        return $this->missionId;
    }

    /**
     * @param int $missionId
     */
    public function setMissionId(int $missionId): self
    {
        $this->missionId = $missionId;

        return $this;
    }
}
